import request from '@/utils/request'



//获取角色、职位分页数据
export function dataList(form, pageSize, currentPage) {
  return request.post('/role/page', {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  })
}

export function addData(options) {
  return request.post('/role/save', options)
}

export function updateData(options) {
  return request.put('/role/save',options)
}

/**
 * 角色详情
 * @param {*} id 
 */
export function details(id) {
  return request.get(`/role/${id}`)
}

/**
 * 删除角色
 * @param {*} id 
 */
export function deleteData(id) {
  return request.delete(`/role/${id}`)
}

/**
 * 获取菜单树
 * @param {*} userId 
 */
export function menuList() {
  let userId=JSON.parse(sessionStorage.getItem('login')).id;
  return request.get(`/base/menu/tree/${userId}`)
}
/**
 * 根据门店获取所有职位信息
 * @param {*} storeId 
 */
export function roleGetStoreRole(storeId) {
  return request.get(`/role/getStoreRole/${storeId}`)
}


